def user_is_teacher(user):
    p = user.get_profile()
    return p.type==1

def user_is_student(user):
    p = user.get_profile()
    return p.type==2

def user_can_createGroup(user):
    p = user.get_profile()
    return p.group.name=="DefaultGroup" and p.type==2

def user_in_group(user):
    p = user.get_profile()
    return p.group.name!="DefaultGroup"
        